const pictures = import.meta.globEager('../../../assets/bpmn/*.{jpg,png}')
const customElements = ['bpmn:StartEvent', 'bpmn:EndEvent', 'bpmn:Task', 'bpmn:IntermediateThrowEvent', 'bpmn:ExclusiveGateway', 'bpmn:ServiceTask', 'bpmn:UserTask', 'bpmn:DataStoreReference', 'bpmn:DataObjectReference'] // 自定义元素的类型
const hasLabelElements = ['bpmn:StartEvent', 'bpmn:EndEvent', 'bpmn:IntermediateThrowEvent', 'bpmn:ExclusiveGateway', 'bpmn:DataStoreReference', 'bpmn:DataObjectReference'] // 初始包含label的元素

const customConfig = { // 自定义元素的配置
  'bpmn:StartEvent': {
    'url': pictures['../../../assets/bpmn/start.png'].default,
    'attr': { x: 0, y: 0, width: 36, height: 36 }
  },
  'bpmn:EndEvent': {
    'url': pictures['../../../assets/bpmn/end.png'].default,
    'attr': { x: 0, y: 0, width: 36, height: 36 }
  },
  'bpmn:Task': {
    'url': pictures['../../../assets/bpmn/task-box.png'].default,
    'attr': { x: 0, y: 0, width: 180, height: 48 }
  },
  'bpmn:ServiceTask': {
    'url': pictures['../../../assets/bpmn/task-box.png'].default,
    'attr': { x: 0, y: 0, width: 180, height: 48 }
  },
  'bpmn:UserTask': {
    'url': pictures['../../../assets/bpmn/task-box.png'].default,
    'attr': { x: 0, y: 0, width: 180, height: 48 }
  },
  'bpmn:IntermediateThrowEvent': {
    'url': pictures['../../../assets/bpmn/intermediate.png'].default,
    'attr': { x: 0, y: 0, width: 36, height: 36 }
  },
  'bpmn:ExclusiveGateway': {
    'url': pictures['../../../assets/bpmn/gateway.png'].default,
    'attr': { x: 0, y: 0, width: 36, height: 36 }
  },
  'bpmn:DataStoreReference': {
    'url': pictures['../../../assets/bpmn/data-store.png'].default,
    'attr': { x: 0, y: 0, width: 50, height: 50 }
  },
  'bpmn:DataObjectReference': {
    'url': pictures['../../../assets/bpmn/data-object.png'].default,
    'attr': { x: 0, y: 0, width: 50, height: 50 }
  }
}

const hasIconElements = ['bpmn:ServiceTask', 'bpmn:UserTask'] // 需要渲染icon的元素


const customIconConfig = { // 自定义图标的配置
  // y:24 === 10(icon自身偏移) + 14（盒子偏移）
  'bpmn:ServiceTask': {
    'url': pictures['../../../assets/bpmn/service-task.png'].default,
    'attr': { x: 10, y: 10, width: 28, height: 28 }
  },
  'bpmn:UserTask': {
    'url': pictures['../../../assets/bpmn/user-task.png'].default,
    'attr': { x: 10, y: 10, width: 28, height: 28 }
  },
}

export { customElements, hasLabelElements, customConfig, hasIconElements, customIconConfig }